Skip to content

feat(aggregator): global search slice 2 — registry, DNS, services, tier items (#1212) - #7331

Merged
dezren39 merged 2 commits into
mainfrom
queue/12609-1212-search-slice2
Nov 8, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/12609-1212-search-slice2

Conversation

@dezren39

@dezren39 dezren39 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements slice 2 of issue #1212 (queue task 12609), scoped to the remainder confirmed by triage task 11920. Slice 1 (PR #3969, merged) gave /search board+roadmap only; this PR adds the remaining subjects and detail links.

  • searchWork gains an optional extras argument (registry sessions, DNS section, usage-hub services, orchestration tier items); first-slice callers are unchanged.
  • Every SearchResult now carries a stable detail href: board/roadmap keep /item/; sessions link /sessions?id=# (the established authorBadge pattern); DNS entries link /dns#dns- (dnsTable rows now render a per-domain anchor; the existing #dns-next-renewal anchor is untouched); services link /quota/service/; tier items link their session view, or their /discuss/ page via the tierItemObjectRef keying. All targets are existing routes, so no new SUBROUTE_PARENTS entries are needed.
  • renderSearch links each card to its own href (was /item/ for everything) and the page freshness chips now include the facets of every result kind home page (dns, registry, quota, usage, orchestration, attention) alongside board/roadmap/items.
  • searchContext loads the extra sources fail-soft: one broken source degrades to empty instead of taking search down.
  • Pages manifest blurb for /search updated to match.
  • Refs #1212 — this is slice 2 of its acceptance, not a close: the issue stays open for any remaining verification.

    Tests

    • bun test test/search-view.test.ts — 10/10 pass (3 first-slice + 7 new slice-2 tests: per-kind finds, hrefs, chips, backward compatibility).
    • Neighboring suites pass: render, nav, views, service-links, registry-view, ui-overhaul, overview, program, queue-view, projects.
    • test/slice3.test.ts fails identically on clean main in this environment: it spawns the real server, which cannot bind port 4871 while the live aggregator is running. Pre-existing/environmental, unrelated to this change; the DNS anchor strings it asserts (#dns-next-renewal) are unchanged.
    • bunx tsc --noEmit: no errors in the changed files; the single error in test/roadmap-annotations.test.ts exists on clean main too.

    Merge Danger

    Door: two-way (additive search subjects + one anchor attribute per DNS row). Blast radius: /search and /api/search.json only, plus a rendered id attribute on /dns rows.


    Autofix with [code]smith
    Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…er items (#1212)

Search (slice 1, PR #3969) covered only board and roadmap subjects.
Slice 2 extends searchWork with the registry/session records, the
DNS register, the usage-hub services, and the orchestration tier
items, each result carrying a stable detail href: /item/<id> for
board/roadmap, /sessions?id=<id>#<id> for sessions, /dns#dns-<domain>
for register rows (dnsTable now renders a per-domain anchor),
/quota/service/<id> for services, and the session view or the
/discuss/<object> page for tier items. renderSearch links each card
to its own detail view and carries the freshness facets of every
result kind home page; searchContext loads the extra sources
fail-soft so one broken source never takes search down.

Refs #1212 (slice 2 of the issue acceptance; does not close it).
@dezren39
dezren39 requested a review from a team as a code owner November 8, 2026 05:59
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4339ffcd-4045-4643-a0c2-654acceb1738
Commits

Reviewing files that changed from the base of the PR and between 36e5b3e and 0ba2dc9.

Files selected for processing: 5

  • pm-stack/aggregator/src/pages.ts
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/src/search-view.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/test/search-view.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T06:29:58.660640Z 0ba2dc9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f784279442

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/aggregator/src/search-view.ts Outdated
id: item.id,
title: item.title,
summary: `${item.source} · ${item.state ?? item.kind}`,
refs: item.ref ? [item.ref] : [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate tier refs before exposing them as GitHub badges

When a matching tier item carries a tracked-goal ID such as goal_b647ff5c92f5 in ref, this passes it to renderSearch, whose unresolved-badge path calls refUrl(ref) unconditionally. parseRef then throws, causing the entire /search request to fail. This is a supported input: tierItemCard already guards non-GitHub refs with isValidRef, and test/dashboard-overhaul.test.ts covers that exact goal ID. Filter these values out of the GitHub badge refs or render them as plain text.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0ba2dc9 (task 12609, lane code-e): searchWork now filters tier (and registry) refs with isValidRef before they become badge refs, so a tracked-goal id like goal_b647ff5c92f5 never reaches refUrl; renderSearch also renders any non-GitHub ref that still arrives as a plain-text badge instead of a refUrl link (defense in depth). Regression tests in search-view.test.ts cover both layers.

Comment on lines +572 to +574
const tierItems = orchestration ? [...orchestration.tiers.needsDrew, ...orchestration.tiers.needsOrchestrator] : [];
const extras = { registry, dns, services: usage?.services ?? [], tierItems };
return { query, results: searchWork(board, rows, items, query, extras), items };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve refs from the newly added search sources

When a registry session or tier item references a GitHub issue that is absent from the board and roadmap, its search badge always renders as unresolved, even if the live project pool or projector can resolve it. searchContext still requests source.items() only for board/roadmap refs, and the live implementation returns only the requested refs, so the new results never receive their projected state. Include registry taskRefs and valid tier-item refs in the resolution set before constructing the results.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0ba2dc9 (task 12609, lane code-e): searchContext now adds registry taskRefs and valid tier-item refs to the resolution set passed to source.items(), so badges for refs carried only by the slice-2 sources resolve against the live pool/projector instead of always rendering unresolved.

Comment thread pm-stack/aggregator/src/render.ts Outdated
.map(
(e) =>
`<tr${e === nextRenewal ? ' id="dns-next-renewal"' : ""} data-dns-row data-dns-status="${esc(e.status)}" data-dns-renewing-soon="${renewingSoon.has(e)}"><td><strong>${esc(e.domain)}</strong></td><td>${esc(e.renewal)}</td><td>${e.priceUsd != null ? `$${e.priceUsd.toFixed(2)}` : "—"}</td><td>${esc(e.autoRenew)}</td><td>${esc(e.plan)}</td><td>${esc(e.review)}</td></tr>`,
`<tr${e === nextRenewal ? ' id="dns-next-renewal"' : ""} data-dns-row data-dns-status="${esc(e.status)}" data-dns-renewing-soon="${renewingSoon.has(e)}"><td><strong id="${dnsAnchor(e.domain)}">${esc(e.domain)}</strong></td><td>${esc(e.renewal)}</td><td>${e.priceUsd != null ? `$${e.priceUsd.toFixed(2)}` : "—"}</td><td>${esc(e.autoRenew)}</td><td>${esc(e.plan)}</td><td>${esc(e.review)}</td></tr>`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape the domain-derived DNS anchor attribute

When a register/feed entry contains HTML metacharacters in its domain, the new anchor interpolates them directly into a quoted attribute. dnsAnchor only lowercases its input, while isDnsSection accepts any string domain and the register parsers do not enforce hostname syntax. An otherwise valid entry with domain x"><img src=x onerror=alert(1)> therefore injects executable markup into /dns; previously the domain was rendered only through esc(e.domain). Apply esc to the generated anchor before inserting it into HTML.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0ba2dc9 (task 12609, lane code-e): the /dns row anchor now renders as id="${esc(dnsAnchor(e.domain))}", so a domain carrying HTML metacharacters cannot break out of the attribute. Regression test renders a register whose domain is x"> and asserts the escaped anchor.

Comment on lines +117 to +118
record.model,
record.directory,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard optional search fields before lowercasing them

When an accepted registry record contains a non-string optional field such as model: 7, a query that does not match an earlier field reaches this value in includesQuery and throws because value?.toLowerCase() only guards against nullish values. isSessionRecord does not validate optional model, title, or directory, so these values can survive ingestion even though the existing sessions renderer safely escapes them. The new DNS matching path has the same problem with fields such as registrar, whose type isDnsSection does not check. One such record therefore breaks both /search and /api/search.json, despite the source-fetch failure handlers. Check that searchable values are strings or sanitize these fields before matching.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0ba2dc9 (task 12609, lane code-e): includesQuery now only matches values that are actually strings (typeof check), so a non-string optional field (registry model: 7, a numeric DNS registrar) is skipped instead of throwing on .toLowerCase(). Regression tests cover both the registry and DNS matching paths.

P1: tier/registry refs are filtered with isValidRef before they become GitHub badges, and renderSearch renders a non-GitHub ref as plain text instead of letting refUrl throw and fail /search. P2: searchContext resolves refs carried only by registry sessions and tier items. P2: the /dns row anchor id is escaped. P2: includesQuery only matches string values, so non-string optional fields (model: 7, a numeric registrar) no longer throw. Regression tests for each finding in search-view.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant